﻿using AppService.IService.Vehicle_tracks;
using Domain.Entity.Basic_information;
using Domain.Entity.System_operation;
using Domain.IRepository.Basic_information;
using Domain.IRepository.Vehicle_tracks;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;

namespace AppService.Service.Vehicle_tracks
{
    [Dependency(ServiceLifetime.Scoped)]
    public class TracksService : ITracksService
    {

        public ITrackRepository trackRepository { get; set; }

        public TracksService(ITrackRepository trackRepository)
        {
            this.trackRepository = trackRepository;
        }

        public List<Wb_meter> GetMeters(int currentPage, int pageSize, string name)
        {
            return trackRepository.GetMeters(name).Skip((currentPage - 1) * pageSize).Take(pageSize).ToList();
        }

        public int GetCount(string name)
        {
            return trackRepository.GetCount(name);
        }

        public Drivers_ment GetDrivers(int id)
        {
            return trackRepository.GetDrivers(id);
        }

        public Vehicles_ment GetVehicles(int id)
        {
            return trackRepository.GetVehicles(id);
        }

        public Wb_meter GetMeter(int id)
        {
            return trackRepository.GetMeter(id);
        }
    }
}
